 //
//  MeSettingHeadView.m
//  MPTLive
//
//  Created by caixun on 16/1/29.
//  Copyright © 2016年 Jeakin. All rights reserved.
//

#import "MeSettingHeadView.h"


@interface MeSettingHeadView ()


@property (nonatomic, strong) TPButton *btn;


@end


@implementation MeSettingHeadView


#pragma mark - ********************** View Lifecycle **********************

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    
    if (self)
    {
        [self regNotification];
        
        [self initVariable];
        
        [self initMainViews];
    }
    
    return self;
}

-(void)willMoveToSuperview:(UIView *)newSuperview
{
    [super willMoveToSuperview:newSuperview];
    
    if(newSuperview == nil)
    {
        [[self subviews] makeObjectsPerformSelector:@selector(removeFromSuperview)];
        
        return ;
    }
}

- (void)dealloc
{
    // 一定要关注这个函数是否被执行了！！！
}


#pragma mark - ********************** Init All Views **********************

- (void)initVariable
{
    
}

- (void)initMainViews
{
    self.btn = [TPButton getWithFrame:CGRectMake(30, 0, screenW-60, self.frame.size.height)];
    self.btn.layer.cornerRadius = 3;
    [self.btn setTitle:@"退出" forState:UIControlStateNormal];
    self.btn.backgroundColor = [UIColor redColor];
    
    [self addSubview:self.btn];
}


#pragma mark - ********************** Functions **********************

#pragma mark - 注册消息

- (void)regNotification
{
    
}

- (void)setBtnTarget:(id)target withLogoutAction:(SEL)logoutAction
{
    [self.btn addTarget:target action:logoutAction forControlEvents:UIControlEventTouchUpInside];
}


#pragma mark - ********************** Button Touch Event **********************

- (void)btnClickDemo:(TPButton *)sender
{
    
}


#pragma mark - ********************** Net Connection Event **********************

#pragma mark - 请求 xxx

- (void)req_URL_xxx
{
    
}

#pragma mark - 处理 xxx

//- (void)reqSucc_URL_xxx:(TPRequest *)req
//{
//    
//}
//
//- (void)reqFail_URL_xxx:(TPRequest *)req
//{
//    
//}


#pragma mark - ********************** Delegate Event **********************

#pragma mark - 代理 xxx



#pragma mark - ********************** Notification Event **********************

#pragma mark - 通知 xxx



@end
